<%@page import="java.text.SimpleDateFormat,java.util.Date" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%--@elvariable id="actionBean" type="able.stripes.AbleActionBean"--%>
<%@ include file="/WEB-INF/jsp/include/taglibs.jspf" %>
<decorator:usePage id="pageContent" />
<fmt:setBundle basename="StripesResources"/>
<%
            boolean front = (request.getRequestURI().indexOf("/home.jsp") > 0); //Hack! main page!!            
            pageContext.setAttribute("front", front, pageContext.PAGE_SCOPE);
            pageContext.setAttribute("datetime", new SimpleDateFormat("dd/MM/yyyy | hh:mm").format(new Date()));
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>:: THv3 ::</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link type="text/css" href="${pageContext.request.contextPath}/css/ui-lightness/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/slide.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/flyOutMenu.css" type="text/css" media="screen">
        <script type='text/javascript' src='${pageContext.request.contextPath}/js/jquery-1.5.2.min.js'></script>
        <script type='text/javascript' src='${pageContext.request.contextPath}/js/jquery-ui-1.8.17.custom.min.js'></script>
        <script src="${pageContext.request.contextPath}/js/slide.js" type="text/javascript"></script>
        <script src="${pageContext.request.contextPath}/js/cufon-yui.js" type="text/javascript"></script>
        <script src="${pageContext.request.contextPath}/js/jquery.easing.1.3.js" type="text/javascript"></script>
        <script src="${pageContext.request.contextPath}/js/jquery-1.1.2.js" type="text/javascript"></script>
        <script src="${pageContext.request.contextPath}/js/jquery.bgiframe.js" type="text/javascript"></script>
        <script src="${pageContext.request.contextPath}/js/jquery.dimensions.js" type="text/javascript"></script>
        <script src="${pageContext.request.contextPath}/js/jquery.jdMenu.js" type="text/javascript"></script>
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/menu/jdMenu.css" type="text/css" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/menu/jdMenu.slate.css" type="text/css" />
        <script type="text/javascript">
            $(document).ready(function(){                
                $('select').each(function(){
                    $(this).focus(function(){
                        $(this).addClass('focus');
                    });
                    $(this).blur(function(){
                        $(this).removeClass('focus');
                    });
                });
                $('input:text').each(function(){
                    if (!$(this).hasClass('normal_text')){
                        $(this).focus(function(){
                            $(this).addClass('focus');
                        });
                        $(this).blur( function() {
                            $(this).removeClass("focus");
                            $(this).val( $(this).val().toUpperCase());
                        });
                    }
                    
                });
            });
                
                
        </script>
        <script type="text/javascript">
                // Initialization, you can leave this here or move this somewhere else
                $(function(){
                    $('ul.jd_menu').jdMenu({	onShow: loadMenu
                        //onHideCheck: onHideCheckMenu,
                        //onHide: onHideMenu, 
                        //onClick: onClickMenu, 
                        //onAnimate: onAnimate
                    });
                    $('ul.jd_menu_vertical').jdMenu({onShow: loadMenu, onHide: unloadMenu, offset: 1, onAnimate: onAnimate});
                });

                function onAnimate(show) {
                    //$(this).fadeIn('slow').show();
                    if (show) {
                        $(this)
                        .css('visibility', 'hidden').show()
                        .css('width', $(this).innerWidth())
                        .hide().css('visibility', 'visible')
                        .fadeIn('normal');
                    } else {
                        $(this).fadeOut('fast');
                    }
                }

                var MENU_COUNTER = 1;
                function loadMenu() {
                    if (this.id == 'dynamicMenu') {
                        $('> ul > li', this).remove();
			
                        var ul = $('<ul></ul>');
                        var t = MENU_COUNTER + 10;
                        for (; MENU_COUNTER < t; MENU_COUNTER++) {
                            $('> ul', this).append('<li>Item ' + MENU_COUNTER + '</li>');
                        }
                    }
                }

                function unloadMenu() {
                    if (MENU_COUNTER >= 30) {
                        MENU_COUNTER = 1;
                    }
                }

                // We're passed a UL
                function onHideCheckMenu() {
                    return !$(this).parent().is('.LOCKED');
                }

                // We're passed a LI
                function onClickMenu() {
                    $(this).toggleClass('LOCKED');
                    return true;
                }
        </script>
        <style type="text/css">
            body {
                background-color:#fdf5ce ;
                margin-top: 7px;
            }
        </style>
        <link href="${pageContext.request.contextPath}/css/sm.css" rel="stylesheet" type="text/css">


        <decorator:head/>
    </head>
    <%--c:set var="menu" value="${empty actionBean.context.userType? 'front' : actionBean.context.userType}"/--%>
    <body>               
       
        <div id="toppanel">
            <div id="panel">
                <div class="content clearfix">
                    <!--                    <div class="left">
                                            <h1>Welcome to Web-Kreation</h1>
                                            <h2>Sliding login panel Demo with jQuery</h2>		
                                            <p class="grey">You can put anything you want in this sliding panel: videos, audio, images, forms... The only limit is your imagination!</p>
                                            <h2>Download</h2>
                                            <p class="grey">To download this script go back to <a href="http://web-kreation.com/index.php/tutorials/nice-clean-sliding-login-panel-built-with-jquery" title="Download">article &raquo;</a></p>
                                        </div>-->
                    <div class="left">
                        <!-- Login Form -->
                        <form:form beanclass="ipfms.stripes.LoginActionBean">
                            <h1>Member Login</h1>
                            <label class="grey" for="log">Username :</label>
                            <s:text name="userLogin" size="23" class="normal_text"/>
                            <label class="grey" for="pwd">Password :</label>
                            <s:password name="userPassword" size="23" class="normal_text"/>
                            <label class="grey"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> &nbsp;Remember me</label>
                            <div class="clear"></div>
                            <s:submit name="login" value="Log In" class="bt_login"/>
                            <a class="lost-pwd" href="#">Lost your password?</a>
                        </form:form>

                    </div>
                    <!--                    <div class="left right">			
                                             Register Form 
                                            <form action="#" method="post">
                                                <h1>Not a member yet? Sign Up!</h1>				
                                                <label class="grey" for="signup">Username:</label>
                                                <input class="field" type="text" name="signup" id="signup" value="" size="23" />
                                                <label class="grey" for="email">Email:</label>
                                                <input class="field" type="text" name="email" id="email" size="23" />
                                                <label>A password will be e-mailed to you.</label>
                                                <input type="submit" name="submit" value="Register" class="bt_register" />
                                            </form>
                                        </div>-->
                </div>
            </div> <!-- /login -->	

            <!-- The tab on top -->	
            <div class="tab">
                <ul class="login">
                    <li class="left">&nbsp;</li>
                    <li>Hello 
                        <c:if test="${empty actionBean.context.currentUser}">Guest!</c:if>
                        <c:if test="${!empty actionBean.context.currentUser}">${actionBean.context.currentUser.idPengguna}!!</c:if>                        
                    </li>
                    <li class="sep">|</li>
                    <c:if test="${empty actionBean.context.currentUser}">
                        <li id="toggle">
                            <a id="open" class="open" href="#">Log In</a>
                            <a id="close" style="display: none;" class="close" href="#">Close</a>			
                        </li>
                    </c:if>
                    <c:if test="${!empty actionBean.context.currentUser}">
                        <li>
                            <a href="logout" class="close">Logout</a>                       
                        </li>
                    </c:if>
                    <li class="right">&nbsp;</li>
                </ul> 
            </div> <!-- / top -->

        </div> <!--panel -->

        <div class="framecontentLeft">
        <table width="1026" border="0" align="center" cellpadding="0" cellspacing="0" class="normaltext">
            <tr>
                <td>
                    <img src="images/banner.png" width="1026" height="102" >
                </td>
            </tr>
            <tr>
                <td >
                    <table width="1026" border="0" cellpadding="0" cellspacing="0" class="normaltext">
                        <tr background="images/topmenu_bg.jpg">
                            <td width="500">
                                <ul class="jd_menu jd_menu_slate">
                                    <li><a href="welcome" >Home</a></li>
                                    <c:if test="${!empty actionBean.context.currentUser}">
                                        <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '01'}">
                                            <li><a href="property" >| Post Property</a></li></c:if>
                                        <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '02'
                                                      || actionBean.context.currentUser.kodJenisPengguna.code eq '03'
                                                      || actionBean.context.currentUser.kodJenisPengguna.code eq '05'}">
                                              <li><a href="inbox" >| Inbox</a></li></c:if>
                                        <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '07'}">
                                            <li><a href="#" class="accessible"> |Maintenance</a>
                                                <ul>
                                                    <li><a href="report_form">Report Faulty</a></li>
                                                    <li><a href="check_complaint"> | Check Complaints</a></li>
                                                </ul></li>
                                            </c:if>
                                            <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '06'}">
                                            <li><a href="#" class="accessible"> | Maintenance</a>
                                                <ul>
                                                    <li><a href="report_list">List Of Complaints</a></li>
                                                    <li><a href="check_complaint"> Check Complaints</a></li>
                                                </ul></li>
                                            </c:if>
                                            <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '99'}">
                                            <li><a href="#" > | UAM</a>
                                             <ul>
                                                    <li><a href="uam_register">Registration User</a></li>
                                                    <li><a href="chg_pwd">Change Password</a></li>
                                                </ul></li></c:if>
                                    </c:if>
                                </ul>
                            </td>
                            <td width="422"><div align="right">Contact | Customer Services | Help</div></td>                            
                            <td width="18">&nbsp;</td>
                        </tr>                        
                    </table>
                </td>
            </tr>
            <tr>
                <td bgcolor="#FFFFFF">
                    <table width="1024" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="8"><img src="images/1_1_empty.gif" width="8" height="1"></td>
                                <%--td width="202" valign="top">
                                    <c:choose>
                                        <c:when test="${(menu eq 'buyer') or (menu eq 'supplier')}">
                                            <jsp:include page="/WEB-INF/jsp/om/company/menu_${menu}.jsp"/>
                                        </c:when>
                                        <c:when test="${menu ne 'front'}">
                                            <jsp:include page="/WEB-INF/jsp/om/${menu}/menu.jsp"/>
                                        </c:when>
                                        <c:otherwise>
                                            <jsp:include page="/WEB-INF/jsp/om/menu.jsp"/>
                                        </c:otherwise>
                                    </c:choose>
                                </td--%>
                            <td width="8"><img src="images/1_1_empty.gif" width="8" height="1"></td>
                            <td width="724" valign="top"<c:if test="${front}">background="images/bg_grey.jpg"</c:if>>
                                <decorator:body/>
                            </td>     
                            <td width="18">&nbsp;</td>
                            <%--<c:if test="${front}">
                                <td width="8"><img src="images/1_1_empty.gif" width="8" height="1"></td>
                                <td width="254" valign="top"><%@ include file="/WEB-INF/decorators/main_right.jsp"%></td>
                                <td width="8"><img src="images/1_1_empty.gif" width="8" height="1"></td>
                                </c:if>
                                <c:if test="${!front}">
                                
                            </c:if> --%>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td bgcolor="#FFFFFF">
                    <table width="1024" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="8"><img src="images/1_1_empty.gif" width="8" height="1"></td>
                               
                            <td width="8"><img src="images/1_1_empty.gif" width="8" height="1"></td>
                            <td width="724" valign="top">
                                <c:if test="${front}"><%@ include file="/WEB-INF/decorators/main_right.jsp"%></c:if>
                                <c:if test="${!front}"><img src="images/1_1_empty.gif" width="8" height="20"></c:if>
                            </td>     
                            <td width="18">&nbsp;</td>                           
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td width="8"><img src="images/1_1_empty.gif" width="8" height="1"></td>
            </tr>
            <tr>
                <td bgcolor="#d6bc74">&nbsp;</td>
            </tr>
            <tr>
                <td bgcolor="#d6bc74">
                    <div align="center" class="normaltext">                        
                        &copy; Copyright 2011 iPFMS. All Rights Reserved. Disclaimer | Terms and Condition
                    </div>
                </td>
            </tr>
            <tr>
                <td bgcolor="#d6bc74">&nbsp;</td>
            </tr>
            <%--<tr>
                <td width="8"><img src="images/1_1_empty.gif" width="8" height="20"></td>
            </tr>--%>

        </table>       </div>
    </body>
</html>